package com.smartum.mpr.client.view;

import com.smartgwt.client.types.ImageStyle;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.layout.HLayout;

/**
 * Class represents mask panel, which blocks UI, to prevent possible double clicks.
 */
public class MaskPanel extends Window {

    public MaskPanel() {
        Img loadingIcon = new Img("processor.gif", 75, 75);
        loadingIcon.setShowEdges(false);
        loadingIcon.setImageType(ImageStyle.NORMAL);
        loadingIcon.setPadding(6);

        HLayout hLayout = new HLayout();
        hLayout.addMember(loadingIcon);

        this.setShowHeader(false);
        this.setShowCustomScrollbars(false);
        this.setModalMaskOpacity(80);
        this.setShowEdges(false);
        this.setLayoutMargin(0);
        this.setBodyStyle("");
        this.setBodyColor("transparent");
        this.setShowHeaderBackground(false);
        this.setShowHeaderIcon(false);
        this.setIsModal(true);
        this.setShowModalMask(true);
        this.setCanDragReposition(false);
        this.setCanDrag(false);
        this.setWidth("85px");
        this.setHeight("85px");
        this.addItem(hLayout);
        this.centerInPage();
    }
}
